

import requests
from util.chaojiying import get_code_by_base64, get_money

while True:
    res = requests.get('https://www.labnetwork.com.cn/gateway/basic/mall/oauth/code?0.9391157819913147')

    uuid = res.json()['data']['uuid']
    img_base64 = res.json()['data']['img'][22:]


    r = get_code_by_base64(img_base64, 1902)
    print(r)

    res = requests.post('https://www.labnetwork.com.cn/gateway/basic/mall/oauth/login', json={
        "userEmail": "335801501@qq.com",
        "password": "Fan030311",
        "captchaCode": r['pic_str'],
        "captchaKey": uuid
    })

    result = res.json()
    if result['status'] == 190004:
        print(f"验证码识别错误")
        temp = get_money(r['pic_id'])
        print(temp)
    else:
        print(result)
        break